package com.tonann.app.service.impl;

import java.util.List;
import com.tonann.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tonann.app.mapper.AppFaultHandleRecordMapper;
import com.tonann.app.domain.AppFaultHandleRecord;
import com.tonann.app.service.IAppFaultHandleRecordService;

/**
 * 故障处理记录Service业务层处理
 * 
 * @author tonann
 * @date 2022-10-15
 */
@Service
public class AppFaultHandleRecordServiceImpl implements IAppFaultHandleRecordService 
{
    @Autowired
    private AppFaultHandleRecordMapper appFaultHandleRecordMapper;

    /**
     * 查询故障处理记录
     * 
     * @param id 故障处理记录主键
     * @return 故障处理记录
     */
    @Override
    public AppFaultHandleRecord selectAppFaultHandleRecordById(Long id)
    {
        return appFaultHandleRecordMapper.selectAppFaultHandleRecordById(id);
    }

    /**
     * 查询故障处理记录列表
     * 
     * @param appFaultHandleRecord 故障处理记录
     * @return 故障处理记录
     */
    @Override
    public List<AppFaultHandleRecord> selectAppFaultHandleRecordList(AppFaultHandleRecord appFaultHandleRecord)
    {
        return appFaultHandleRecordMapper.selectAppFaultHandleRecordList(appFaultHandleRecord);
    }

    /**
     * 新增故障处理记录
     * 
     * @param appFaultHandleRecord 故障处理记录
     * @return 结果
     */
    @Override
    public int insertAppFaultHandleRecord(AppFaultHandleRecord appFaultHandleRecord)
    {
        appFaultHandleRecord.setCreateTime(DateUtils.getNowDate());
        return appFaultHandleRecordMapper.insertAppFaultHandleRecord(appFaultHandleRecord);
    }

    /**
     * 修改故障处理记录
     * 
     * @param appFaultHandleRecord 故障处理记录
     * @return 结果
     */
    @Override
    public int updateAppFaultHandleRecord(AppFaultHandleRecord appFaultHandleRecord)
    {
        appFaultHandleRecord.setUpdateTime(DateUtils.getNowDate());
        return appFaultHandleRecordMapper.updateAppFaultHandleRecord(appFaultHandleRecord);
    }

    /**
     * 批量删除故障处理记录
     * 
     * @param ids 需要删除的故障处理记录主键
     * @return 结果
     */
    @Override
    public int deleteAppFaultHandleRecordByIds(Long[] ids)
    {
        return appFaultHandleRecordMapper.deleteAppFaultHandleRecordByIds(ids);
    }

    /**
     * 删除故障处理记录信息
     * 
     * @param id 故障处理记录主键
     * @return 结果
     */
    @Override
    public int deleteAppFaultHandleRecordById(Long id)
    {
        return appFaultHandleRecordMapper.deleteAppFaultHandleRecordById(id);
    }
}
